const express = require('express')
const path = require('path')
const app = express()
const port = process.env.NODE_PORT || 7010
const BUILD_PATH = 'dist'
const debug = console.log.bind(console)

app.use(express.static(BUILD_PATH))

app.get('/*', function (req, res) {
  res.sendFile(path.join(__dirname, `./${BUILD_PATH}`, 'index.html'))
})

app.listen(port, () => {
  debug(``)
  debug(`Success!!!, Welcome to E-PORTS 船东系统\nPort:${port}`)
  debug(``)
  debug(``)
  debug("d88888b        d8888b.  .d88b.  d8888b. d888888b .d8888. ")
  debug("88'            88  `8D .8P  Y8. 88  `8D    88    88'  YP ")
  debug("8800000        88oodD' 88    88 88oobY'    88    `8bo.   ")
  debug("88~~~~~ C8888D 88      88    88 88`8b      88      `Y8b. ")
  debug("88.            88      `8b  d8' 88 `88.    88    db   8D ")
  debug("Y88888P        88       `Y88P'  88   YD    YP    `8888Y' ")
  debug(``)
  debug(``)
})
